﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SailHero.Soft.FrameWork.DAO.Core;
using SailHero.Soft.FrameWork.IDomainRepositories.Contracts;
using SailHero.Soft.FrameWork.Models;

namespace SailHero.Soft.FrameWork.DomainRepositories
{
    public class SysAdminRepository : EFRepository<MenuInfo>, ISysAdminRepository
    {

        public SysAdminRepository()
            : base("SysAdmin")
        {
        }

        public List<MenuInfo> GetMenus()
        {
            return GetAllList().ToList();
        }

        public void Update(MenuInfo meninfo)
        {
            MenuInfo obj = FirstOrDefault(itm => itm.Id == meninfo.Id);
            UpdateRef(meninfo, ref obj);
            UnitOfWork.SaveChanges();
        }
    }
}
